home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 2
/
AACD 2.iso
/
AACD
/
Magazine
/
GraphicsCards
/
StormMesa
/
mklib.openbsd
< prev
next >
Wrap
Text File
|
1998-12-15
|
1KB
|
52 lines
#!/bin/sh
# Make a OpenBSD shared library
# contributed by thomas graichen (graichen@OpenBSD.org)
#--identification------------------------------------------------------
# $Id: mklib.openbsd,v 1.6 1997/10/21 23:32:31 brianp Exp $
# $Log: mklib.openbsd,v $
# Revision 1.6 1997/10/21 23:32:31 brianp
# now takes major and minor version arguments
#
#--common--------------------------------------------------------------
# Usage: mklib libname major minor file.o ...
#
# First argument is name of output library (LIBRARY)
# Second arg is major version number (MAJOR)
# Third arg is minor version number (MINOR)
# Rest of arguments are object files (OBJECTS)
LIBRARY=$1
shift 1
MAJOR=$1
shift 1
MINOR=$1
shift 1
OBJECTS=$*
#--platform------------------------------------------------------------
set -x
LIBRARY=`basename $LIBRARY .so`
VERSION="${MAJOR}.${MINOR}"
echo "Building PIC library $LIBRARY"
rm -f ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION}
ar cq ${LIBRARY}_pic.a ${OBJECTS}
ranlib ${LIBRARY}_pic.a
ld -x -Bshareable -Bforcearchive -o ${LIBRARY}.so.${VERSION} ${LIBRARY}_pic.a
cp ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ../lib
ln -s ../lib/${LIBRARY}.so.${VERSION} ../lib/${LIBRARY}.so